// index.js
// const app = getApp()
const { envList } = require('../../envList.js');

Page({
  data: {
    indicatorDots: false,
    autoplay: false,
    interval: 3000,
    duration: 800,
    list:[{id:1,title:'键盘',image:'/images/666.png',num:4,price:100},
    {id:2,title:'笔记本',image:'/images/666.png',num:1,price:3000}
    ]
  },
  onReady() {
    var self = this;
    wx.getStorage({
      key: 'individual',
      success: function(res){
        self.setData({
          individual:res.data,
          hasined:true
        })
      }
    });
    const db = wx.cloud.database();
    const _ = db.command;
    db.collection('goods').where({
     
    })
    .get({
      success: function(res) {
      this.data.list.push({id:this.data.i,title:res.data[0].title,image:'/images/666.png',
      detail:res.data[0].detail,price:res.data[0].price});
      console.log(this.data.list);
      self.setData({
        i:i+1
      })
      }
    })
  }

})